import request from '@/utils/request'
export default {
    //省市区级联查询
    searchLocation(pid) {
        return request({
            url: `/district/select?pid=${pid}`,
            method: 'get'
        })
    },
    //上传闲置物品
    addShop(addMap) {
        return request({
            url: '/saleGoods/add',
            method: 'post',
            data: addMap,
        })
    },
    /* 商品展示  */
    searchShop(page, itemsPerPage) {
        return request({
            url: `/saleGoods/select?key=5749495156575544565e501c180b585049505f&page=${page}&itemsPerPage=${itemsPerPage}`,
            //url:`/saleGoods/select?key=574949515656524b5651501c100c&page=1&itemsPerPage=1`,
            method: 'get'
        })
    },
    //修改状态 
    updateState(updateMap) {
        return request({
            url: '/saleGoods/updateState',
            method: 'PUT',
            data: updateMap
        })
    },
    //删除
    deleteShop(id) {
        return request({
            url: `/saleGoods/delete?id=${id}`,
            method: 'delete',
        })
    },
    //查看详情
    findShopById(id) {
        return request({
            url: `/saleGoods/selectById?id=${id}`,
            method: 'get',
        })
    }
}